package com.xxx.corejava.day1125;

public class Room {
    private String no;
    private boolean state;
    private Customer customer;

    public Room(String no) {
        this.no = no;
        state=false;
        customer=null;
    }

    public boolean in(Customer customer){
        this.customer=customer;
        state=true;
        return true;
    }

    public boolean out(){
        this.customer=null;
        state=false;
        return true;
    }

    @Override
    public String toString() {
        return String.format("%4s",true==state?customer.getName():"空房");
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public boolean isState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }
}
